package com.extractor;

import com.gui.Mas;

import javax.swing.*;
import java.awt.*;
import java.util.*;

/**
 * Created by IntelliJ IDEA.
 * User: SeedMiner
 * Date: Jun 28, 2010
 * Time: 9:20:20 PM
 * To change this template use File | Settings | File Templates.
 */
public class Main {
    public static void main(String[] args) {
        /*AlgorithmMAS am= new AlgorithmMAS();
        ArrayList<Integer> product = DataExtractor.getProduction(*//*production*//*"388883,44,11,17"+'\n');
        RatioOutputs r0 = am.findRatios(50, 8, "388883", "44", product);*/
        try {
            UIManager.setLookAndFeel(
                UIManager.getSystemLookAndFeelClassName());
        } catch (ClassNotFoundException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (InstantiationException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (IllegalAccessException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        } catch (UnsupportedLookAndFeelException e) {
            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
        }
        DataExtractor de = new DataExtractor();
        de.createFabricTable();
        //de.createFabricTable();
        JFrame frame = new JFrame("MAS");
        Mas mas=new Mas();
        de.mas=mas;
        mas.de=de;
        frame.setContentPane(mas.panel1);
        //JPanel mainPanel = new JPanel();
        //de.mainPanel = mainPanel;
        //FlowLayout layout = new FlowLayout();
        //mas.panel1.setLayout(layout);
        //layout.setAlignment(FlowLayout.LEADING);
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.pack();
        frame.setVisible(true);
        Toolkit toolkit = Toolkit.getDefaultToolkit();
        Dimension dim = toolkit.getScreenSize();
        int height=700;
        int width=950;
        frame.setBounds(dim.width/2-width/2,dim.height/2-height/2,width,height);
        /*Map<Object,String> mp=new HashMap<Object, String>();

        // adding or set elements in Map by put method key and value pair
        mp.put("a"*//*new Integer(2)*//*, "Two");
        mp.put("d"*//*new Integer(1)*//*, "One");
        mp.put("c"*//*new Integer(3)*//*, "Three");
        mp.put("a"*//*new Integer(4)*//*, "Four");
        if(mp.containsKey("a")){
            System.out.println("dup");
        }


        //Get Map in Set interface to get key and value
        Set s=mp.entrySet();

        //Move next key and value of Map by iterator
        Iterator it=s.iterator();

        while(it.hasNext())
        {
            // key=value separator this by Map.Entry to get key and value
            Map.Entry m =(Map.Entry)it.next();

            // getKey is used to get key of Map
            int key=(Integer)m.getKey();

            // getValue is used to get value of key in Map
            String value=(String)m.getValue();

            System.out.println("Key :"+key+"  Value :"+value);
        }*/
    }
}
